package com.loong.rpc.register;

import com.loong.rpc.common.ServiceURL;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class RemoteRegister {
    private static final Map<String, List<ServiceURL>> map = new HashMap<>();

    public static void regist(String interfaceName, ServiceURL serviceURL) {
        List<ServiceURL> list = map.get(interfaceName);
        if (list == null) {
            list = new ArrayList<>();
        }
        list.add(serviceURL);
        map.put(interfaceName, list);
    }

    public static List<ServiceURL> get(String interfaceName) {
        return map.get(interfaceName);
    }
}
